package com.example.splash;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

public class Splash extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
      
        requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
		
		  setContentView(R.layout.splash);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
    
    /**
     * Executed when the first button is pulsed
     * Opens a new view with a parameter
     * @param v
     */
    public void botton (View v){
    	Intent intent = new Intent(this,MainActivity.class);
		intent.putExtra("extraValue","I know u clicked that button!");
		startActivity(intent);
    }
    /**
     * Executed when clicked the second button
     * opens a new view
     * @param v
     */
    public void ChildActivity (View v){
    	Intent intent = new Intent(this, ChildActivity.class);
    	startActivityForResult(intent,666);
    }
    /**
     * executed when the children view are closed
     * gets the extra data
     */
    protected void onActivityResult(int requestCode, int resultCode, Intent data){
    	super.onActivityResult(requestCode,resultCode, data);
    	Log.d("Debug","Req code:" + requestCode + ". Result code: "+ resultCode);
    	Log.d("Debug","Extra data: " + data.getStringExtra("someData"));
    }
}
	